package com.example.jdkproxydemo;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

/**
 * @Author: wyp
 * @Date: 2021/9/1 16:22
 */
public class PersonProxy implements InvocationHandler {

    private Object object;

    public PersonProxy(Object object) {
        this.object = object;
    }

    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
        System.out.println("AOP代理方法执行前的操作---------");
        method.invoke(object,args);
        System.out.println("AOP代理方法执行后的操作---------");
        return proxy;
    }
}
